// Harvester.java
package com.smartfarm.domain;

import com.smartfarm.strategy.EmergencyPath;
import com.smartfarm.strategy.PathStrategy;
import com.smartfarm.strategy.OptimalPath;

public class Harvester extends FarmMachinery {
    public Harvester(String id) {
        super(id);
        setStrategy(new OptimalPath());
    }

    public void update(String event) {
        System.out.println("收割机" + id + "收到更新: " + event);
        if (event.contains("湿度异常")) {
            setStrategy(new EmergencyPath());
        }
    }
}